package book;

public class BookList {
    private Book[] books = new Book[10];
    private int usedSize;

    public BookList() {
        books[0] = new Book("命运","蔡崇达",60,"社会小说");
        books[1] = new Book("绝叫","叶真中显",30,"悬疑推理");
        books[2] = new Book("教父","马里奥·普佐",60,"外国文学");
        this.usedSize = 3;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public boolean isFull(){
        if(usedSize == books.length)
            return true;
        else
            return false;
    }

    public void addBook(int pos,Book book){
        books[pos] = book;
    }

    public Book getBook(int pos){
        return books[pos];
    }

    public void setBooks(int pos, Book book){
        books[pos] = book;
    }

}
